<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文章列表页</title>
    <script src="/assets/js/token.js"></script>
    <link rel="stylesheet" href="/assets/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/assets/css/article/art_article.css">
</head>

<body>
    <div class="layui-card">
        <div class="layui-card-header">文章列表</div>
        <div class="layui-card-body">
            <!-- 表单区 （搜索区域） -->
            <form class="layui-form" action="">

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <!-- 第一个下拉框 -->
                        <div id="category" class="layui-input-inline" style="width: 200px;">
                            <!-- 这里放分类 -->
                        </div>
                        <!-- <div class="layui-form-mid">-</div> -->
                        <!-- 第二个下拉框 -->
                        <div class="layui-input-inline" style="width: 200px;">
                            <select name="state" lay-verify="">
                                <option value="">全部状态</option>
                                <option value="已发布">已发布</option>
                                <option value="草稿">草稿</option>
                            </select>
                        </div>
                    </div>
                    <!-- 按钮 -->
                    <div class="layui-inline">
                        <div class="layui-input-inline" style="width: 100px;">
                            <button type="submit" class="layui-btn">搜索</button>
                        </div>
                    </div>

                </div>
            </form>
            <!-- 表格区 -->
            <table class="layui-table">
                <colgroup>
                    <col width="600">
                    <col width="180">
                    <col width="180">
                    <col width="180">
                    <col>
                </colgroup>
                <thead>
                    <tr>
                        <th>文章标题</th>
                        <th>分类</th>
                        <th>发表时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- 这里放数据 -->
                </tbody>
            </table>

            <!-- 分页区 -->
            <div id="page"></div>
        </div>
    </div>

    <!-- 定义文章列表的模板 -->
    <script type="text/html" id="tpl-list">
        {{each data val}}
        <tr>
            <td>{{val.title}}</td>
            <td>{{val.cate_name}}</td>
            <td>{{val.pub_date|formatDate}}</td>
            <td>{{val.state}}</td>
            <td>
                <button data-id="{{val.Id}}" type="button" class="layui-btn layui-btn-xs editArticle">编辑</button>
                <button data-id="{{val.Id}}" type="button" class="layui-btn layui-btn-xs layui-btn-danger deleteArt">删除</button>
            </td>
        </tr>
        {{/each}}
    </script>

    <!-- 分类列表的模板 -->
    <script type="text/html" id="tpl-category">
        <select name="cate_id" lay-verify="required">
            <option value="">全部分类</option>
            {{each data val}}
            <option value="{{val.Id}}">{{val.name}}</option>
            {{/each}}
        </select>
    </script>

    <script src="/assets/lib/jquery.js"></script>
    <script src="/assets/lib/template-web.js"></script>
    <script src="/assets/lib/layui/layui.all.js"></script>
    <script src="/assets/js/baseAPI.js"></script>
    <script src="/assets/js/article/art_article.js"></script>
</body>

</html>